package org.ccams.dao;

import java.util.List;
import org.ccams.domain.TClient;
import org.ccams.util.PageParameter;
import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;


public class TClientDAO extends SqlMapClientDaoSupport {
	
		
	/**
	 * 返回指定页码的角色
	 * @return
	 */
	@SuppressWarnings({ "unchecked", "deprecation" })
	public  List<TClient> getTClientByPage(PageParameter pageParmeter){		
		return getSqlMapClientTemplate().queryForList("tclient.getTClientByPage", pageParmeter);
	}
	/**
	 * 返回记录总数
	 * @return
	 */
	public int getCount(){
		return (Integer)getSqlMapClientTemplate().queryForObject("tclient.getTClientCount");
	}
	/**
	 * 返回所有数据
	 * @return
	 */
	@SuppressWarnings("unchecked")
	public  List<TClient> getAllTClient(){		
		return getSqlMapClientTemplate().queryForList("tclient.getAllTClient");
	}
	/**
	 * add Entity
	 * @param t
	 * @return
	 */
	public int addClient(TClient t ){
		return getSqlMapClientTemplate().update("tclient.addClient", t);
	}
	/**
	 * update Entity
	 * @param t
	 * @return
	 */
	public int updateClient(TClient t ){
		return getSqlMapClientTemplate().update("tclient.updateClient", t);
	}
	/**
	 * delete Entity
	 * @param id
	 * @return
	 */
	public int deleteClient(String idtclient){
		return getSqlMapClientTemplate().update("tclient.deleteClient", idtclient);
	}
}
